package com.cl.service.payGrant;

import java.util.HashMap;

import org.apache.commons.lang.ObjectUtils;

import com.cl.entity.CcPay;



public class CcPaySumImpl {
	public HashMap getHm() {
		return hm;
	}

	public void setHm(HashMap hm) {
		this.hm = hm;
	}

	private HashMap hm;
	
	public CcPaySumImpl(){
		hm = new HashMap();
	}
	
	public void putCcPayByAuthorId(CcPay cp){
		Object obj = hm.get(cp.getAuthorId());
		if(obj!=null && obj.toString().equals("30.0")){
			System.out.println(cp);
		}
		if(obj!=null){
			Integer sum = Integer.parseInt(ObjectUtils.toString(obj));
			sum+=cp.getReward().intValue();
			hm.put(cp.getAuthorId(), sum);
		}else{
			//j 避免出现小数
			hm.put(cp.getAuthorId(), cp.getReward().intValue());
		}
	}
}
